﻿using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using Framework.Library.Base.Base;
using Framework.Library.Base.Extensions;
using Framework.Library.Data.DAL;
using Framework.Library.Data.DAO;
using System.Linq;
using Framework.Library.Core.Utils.GlobalHelper;
using Framework.Library.Data.DAL.JObject;
using Framework.Library.Core.Config;

namespace Framework.Portal.Layouts.Client.Modules.Menu
{
    public partial class UserCommand : BaseControl
    {
        public UserCommand()
        {
        }

        public UserCommand(JSection section)
        {
            if(!string.IsNullOrEmpty(section.parameter))
            {
                string[] arrParams = section.parameter.Split('&');
                if (arrParams.Length > 0)
                    portalId = Convert.ToInt32(arrParams[0].Split('=')[1]);
                if (arrParams.Length > 1)
                    menuId = Convert.ToInt32(arrParams[1].Split('=')[1]);
            }
            MENUNAME = section.title;
        }
        public string MENUNAME = string.Empty;

        protected static int portalId = 0;
        protected static int menuId = 0;
        protected static string curMenu = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                curMenu = Configurations.ROOTDIR + "Default.aspx?p=" + portalId + "&m=" + menuId; 
            }
        }

    }
}